<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <style>
        #box {
            width: 200px;
            height: 200px;
            background-color:rebeccapurple;
            display: block;
        }
    </style>
</head>

<body>
    <button id="info">点老子</button>
    <div id="box" ></div>
    

    <script>

        var oBox = document.getElementById('box');
        var oInfo = document.getElementById('info');


        oInfo.addEventListener('click', function() {
            
            if (oInfo.innerHTML === "点老子") {
                oBox.style.display = 'none';
                oInfo.innerHTML = "再点老子";
            } else {
                oBox.style.display = 'block';
                oInfo.innerHTML = '点老子'
            }
        },false);

        
        
    </script>
</body>

</html>